1 IDENTIFICATION DIVISION
2 PROGRAM-ID ChargeInEMfield
4 COMMENT A mass m with charge q>0 is located in a static electro-magnetic field [0,0,E], [0,-B,0].
5 COMMENT Find the trajetory
6 COMMENT Differential equation (Lorentz force): x'' = omega*z', z'' = a*omega^2 - omega*x'
7 COMMENT good start settings are omega=0,92, a*omega^2=0,05
14 REQUIRES COEFFICIENT 3
21 x'' -> INTEGRATOR.1 -> -x'
22 -x' -> INTEGRATOR.2 -> x
23 -x' -> COEFFICIENT.6 -> -omega*x'
24 +1 -> COEFFICIENT.7 -> a*omega^2
25 a*omega^2, -omega*x' -> INTEGRATOR.4 -> -z' # input is z''
26 -z' -> INTEGRATOR.5 -> z
27 -z' -> INVERTER.1 -> z'
28 z' -> COEFFICIENT.5 -> omega*z' = x''